# Please install OpenAI SDK first: `pip3 install openai`

from openai import OpenAI


def get_answer(api_key, question):
    client = OpenAI(api_key=api_key, base_url="https://api.deepseek.com")
    answer = '│ DP：'
    response = client.chat.completions.create(
        model="deepseek-chat",
        messages=[
            {"role": "system",
            "content": "在选项中找出问题的正确答案，请保证信息的准确，并在回答时保持简洁，不需要任何其他分析反馈。"},
            {"role": "user", "content": question},
        ],
        stream=False
    )
    answer += response.choices[0].message.content
    print(answer)


# get_answer('sk-f8c16266d3b943a8bfd78bbc8c1bb217', '1+1=？ A.1 B.2 C.3 D.4')
